From b7e29a3d67e3e214ba1c958478092ee4075e8171 Mon Sep 17 00:00:00 2001
From: real-zephex <zephex-1@outlook.com>
Date: Thu, 4 Apr 2024 23:00:53 +0530
Subject: inmidst of rewriting the kdrama section. will complete it soon

---
 src/app/anime/[id]/[...animeId]/page.jsx | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(limited to 'src/app/anime/[id]/[...animeId]/page.jsx')

diff --git a/src/app/anime/[id]/[...animeId]/page.jsx b/src/app/anime/[id]/[...animeId]/page.jsx
index 966f212..60c05ee 100644
--- a/src/app/anime/[id]/[...animeId]/page.jsx
+++ b/src/app/anime/[id]/[...animeId]/page.jsx
@@ -10,6 +10,7 @@ import { redirect } from "next/navigation";
 import Link from "next/link";
 
 export default async function Video({ params }) {
+	let link;
 	const id = params.animeId[0];
 	const series = params.animeId[1];
 
@@ -25,7 +26,16 @@ export default async function Video({ params }) {
 		redirect("/404");
 	}
 
-	const link = data.sources[4].url;
+	try {
+		link = data.sources[4].url;
+	} catch (error) {
+		try {
+			link = data.sources[3].url;
+		} catch (error) {
+			redirect("/404");
+			console.log("Episode not found.");
+		}
+	}
 
 	return (
 		<div className={styles.VideoMain}>
-- 
cgit v1.2.3


From 381a1cb5c14270d9bdc8cd56f17c75d79df231de Mon Sep 17 00:00:00 2001
From: real-zephex <zephex-1@outlook.com>
Date: Fri, 5 Apr 2024 09:57:47 +0530
Subject: added caching and video player

---
 src/app/anime/[id]/[...animeId]/page.jsx | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

(limited to 'src/app/anime/[id]/[...animeId]/page.jsx')

diff --git a/src/app/anime/[id]/[...animeId]/page.jsx b/src/app/anime/[id]/[...animeId]/page.jsx
index 60c05ee..950f618 100644
--- a/src/app/anime/[id]/[...animeId]/page.jsx
+++ b/src/app/anime/[id]/[...animeId]/page.jsx
@@ -32,8 +32,8 @@ export default async function Video({ params }) {
 		try {
 			link = data.sources[3].url;
 		} catch (error) {
-			redirect("/404");
 			console.log("Episode not found.");
+			redirect("/404");
 		}
 	}
 
@@ -47,7 +47,6 @@ export default async function Video({ params }) {
 					<MediaPlayer
 						title={words}
 						src={link}
-						playsInline
 						aspectRatio="16/9"
 						load="eager"
 						className={styles.VideoPlayer}
-- 
cgit v1.2.3

